import Vue from 'vue'
import Router from 'vue-router'
// 引入自定义组件
import login from '../views/login/login';
import register from '../views/login/register';
import forget from '../views/forget';
import reset from '../views/reset';
import main from '../views/main/main';
import upload from '../views/upload';
import diskMenu from '../components/muke_right/mukeRight';
import mukeList from '../components/muke_list/mukeList';
import mukeRecycle from '../components/muke_right/mukeRecycle';
import mukeShare from '../components/muke_right/mukeShare';
import share from '../views/share/share';
import shareMain from '../views/share/mainShare';
// user模块
import userMenu from '../views/user/user_menu';
// 声明使用对象
Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/login',
      component:login
    },
    {
      path:'/register',
      component:register
    },
    {
      path:'/forget',
      component:forget
    },
    {
      path:'/password/reset',
      component:reset
    },
    {
      path:'/main',
      component:main,
      children:[
        {
          path:'cloud-disk',
          component:diskMenu,
          children:[
            {
              path:'files',
              component:mukeList
            },
            {
              path:'recycle',
              component:mukeRecycle
            },
            {
              path:'share',
              component:mukeShare
            },
            {
              path:'',
              redirect:'files'
            }
          ]
        },
        {
          path:'user',
          component:userMenu
        },
        {
          path:'',
          redirect:'cloud-disk'
        }
      ]
    },
    {
      path:'/',
      redirect:'/login'
    },
    {
      path:'/upload',
      component:upload
    },
    {
      path:'/share/main/:name',
      component:shareMain,
    },
    {
      path:'/share/:name',
      component:share,
    },
    {
      path:'*',
      redirect:'/login',
      name:'notFound'
    }
  ]
})

